home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17820 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  857 b 

  1. Path: druid.borland.com!usenet
  2. From: johnhuang@earthlink.net
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++ beginner quesion on data member access.
  5. Date: Wed, 17 Apr 1996 18:24:45 GMT
  6. Organization: Borland Intl
  7. Message-ID: <4l3d5l$drc@druid.borland.com>
  8. References: <4kgb76$r3s@HOPPER.ACM.ORG> <316E7140.C5D@platinum.com> <00001a81+0000b22d@msn.com>
  9. NNTP-Posting-Host: jhuang.borland.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. One more reason to always use data access functions:
  13.  
  14. For example, you have a class A with a data member m, and at certain
  15. point in your program there is a bug which changed m to some
  16. un-reasonable value,
  17.  
  18. If you have m as a private data member and use public access member
  19. functions, you can simply set a break point in SetM(...), it won't be
  20. hard to catch the bug. if you have m as a public data member, it won't
  21. be so easy.
  22.  
  23. John
  24.  
  25.